import {useLoaderData, useNavigate} from 'react-router-dom';

function Home() {
    const res = useLoaderData();
    const navigate = useNavigate();
    return (
        <div>this is loadHome:
            <span>{res}</span>
            <button onClick={() => {
                navigate('/detail?name=tom&age=18');
            }}>navigate to detail</button>
        </div>
    )
}

const fetchHome = () => {
    console.log('loadHome......');
    return 'resOfLoadHome-result';
};
export {
    Home,
    fetchHome,
};